function [owner_var_profit, owner_var_profit_sim, carrier_ind_l, owner_ind_I, model_id_l, p, w, share,...
    cons_surplus, cons_surplus_no_error, expmu, carrier_profit, p_sim, ...
    w_sim, share_sim, prod_var_profit, brand_in_mkt, elas_ns, craft_l] =...
    prod_config_profit(prod_attributes_m, ...
    fixed_prod_ind_id, fixed_prod_entry_m, config_by_owner, prod_id_by_oem, ...
    sim_pcoeff, setup, ...
    para_nonlinear, randomdraw, ...
    rand_income, income_norm)
%purpose: compute pricing eqm and other outcome variables for a given product configuration

n_oem = length(config_by_owner);
n_prod = length(prod_attributes_m);

config = zeros(n_prod, 1);
for no = 1 : n_oem        
    if ~isempty(prod_id_by_oem{no})
        in_mkt_id_no = prod_id_by_oem{no}(config_by_owner{no}>0);
        if ~isempty(in_mkt_id_no)
            config(in_mkt_id_no) = 1;
        end
    end
end

if ~isempty(fixed_prod_ind_id)
    config(fixed_prod_ind_id) = fixed_prod_entry_m;    
end

ind_in = find(config);

brand_in_mkt = cell(length(ind_in), 1); 
for k = 1 : length(ind_in)
       brand_in_mkt(k) = prod_attributes_m{ind_in(k)}.brand;
end

[owner_var_profit, owner_var_profit_sim, carrier_ind_l, owner_ind_I, model_id_l, p, w, share,...
    cons_surplus, cons_surplus_no_error, expmu, carrier_profit, p_sim, ...
    w_sim, share_sim, prod_var_profit, elas_ns, craft_l] ...
    = equi_ind(config, prod_attributes_m, [], sim_pcoeff, ...
        setup, para_nonlinear, randomdraw, ...
        rand_income, income_norm);





